

package com.maoshi.shop.platform.config;

import cn.hutool.core.lang.Snowflake;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 店铺bean配置
 * @author LGH
 */
@Configuration
@AllArgsConstructor
public class PlatformBeanConfig {

    private final PlatformConfig platformConfig;

    @Bean
    public Snowflake snowflake() {
    	return new Snowflake(platformConfig.getWorkerId(), platformConfig.getDatacenterId());
    }
}
